{% extends "layout.html" %}

{% block content %}
  <p>Use the the controls below to turn on the water for a specific irrigation zone.</p>

  <form action="" method=post>
    <fieldset>
      <legend>Activate Irrigation</legend>
      Zone
      <select name=zone>
        {% for zone in zones %}
          <option value="{{ zone.0|escape }}">
            {{ zone.1.location|escape }}: {{ zone.1.name|escape }}
          </option>
        {% endfor %}
      </select>
      for
      <select name=secs>
        {% for i in secs_and_mins %}
          <option value="{{ i.0|escape }}">{{ i.1|escape }}</option>
        {% endfor %}
      </select>
      minute(s)
      <input type=submit name=water-zone value=Water> |
      <input type=submit name=get-system-status value="Get System Status"> |
      <input type=submit name=turn-off-everything value="Turn Off Everything">
    </fieldset>
  </form>
        
  {% if status %}
    <form>
      <fieldset>
        <legend>Status</legend>
        {% for item in status.items %}
          {{ item.0|escape }}: {{ item.1|escape }}<br>
        {% endfor %}
      </fieldset>
    </form>
  {% endif %}
{% endblock %}
